package it.desertsupport.model;

public class User {
	
	private Long idUser;
	private String userName;
	private String password;
	private String activated;
	private Role role;
	private Profile profile;
	
	// Constructors
	public User() {}
	
	public User(String userName, String password, String activated, Role role,
			Profile profile) {
		super();
		this.userName = userName;
		this.password = password;
		this.activated = activated;
		this.role = role;
		this.profile = profile;
	}

	public User(Long idUser, String userName, String password, String activated,
			Role role, Profile profile) {
		this.idUser = idUser;
		this.userName = userName;
		this.password = password;
		this.activated = activated;
		this.role = role;
		this.profile = profile;
	}

	// Getter and Setter
	public Long getIdUser() {
		return idUser;
	}
	public void setIdUser(Long idUser) {
		this.idUser = idUser;
	}

	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getActivated() {
		return this.activated;
	}
	public void setActivated(String activated) {
		this.activated = activated;
	}

	public Role getRole() {
		return role;
	}
	public void setRole(Role role) {
		this.role = role;
	}

	public Profile getProfile() {
		return profile;
	}
	public void setProfile(Profile profile) {
		this.profile = profile;
	}
	
	// Methods
	@Override
	public String toString() {
		return "User [idUser=" + idUser + ", userName=" + userName
				+ ", password=" + password + ", activated=" + activated 
				+ ", role=" + role + ", profile="
				+ profile + "]";
	}

	@Override
	public boolean equals(Object object) {
		if(object == null || !(object instanceof User)){
			return false;
		}
		User user = (User) object;
		return user.getIdUser() == this.idUser;
	}

}
